<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Medoo\Medoo;

class Db extends Command
{
    /**
     * 命令行执行命令
     *
     * @var string
     */
    protected $signature = 'db';

    /**
     * 命令描述
     *
     * @var string
     */
    protected $description = 'Date Command';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //这里编写需要执行的动作
        $db = new Medoo([
            'database_type' => 'sqlite',
            'database_file' => database_path('database.sqlite'),
        ]);
        $db->update('feeds',
            ['feedable_type' => 'App\Models\Article'],
            [
                'feedable_type' => '0',
            ]);
        dd($db->log());
    }
}